package com.yxt.qmgf.klotski.vo;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ScoreRecord implements Serializable {
    private static final long serialVersionUID = 1L;

    private String userId;
    private String userName;
    private int gameSize;  // 游戏难度 (3,4,5)
    private int moves;     // 使用步数
    private int score;     // 获得积分
    private long timestamp; // 时间戳

    public ScoreRecord(String userId, String userName, int gameSize, int moves, int score, long timestamp) {
        this.userId = userId;
        this.userName = userName;
        this.gameSize = gameSize;
        this.moves = moves;
        this.score = score;
        this.timestamp = timestamp;
    }

    // Getters
    public String getUserId() { return userId; }
    public String getUserName() { return userName; }
    public int getGameSize() { return gameSize; }
    public int getMoves() { return moves; }
    public int getScore() { return score; }
    public long getTimestamp() { return timestamp; }

    // 获取格式化时间
    public String getFormattedTime() {
        return new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date(timestamp));
    }

    // 获取难度描述
    public String getDifficulty() {
        switch (gameSize) {
            case 3: return "简单 (3×3)";
            case 4: return "中等 (4×4)";
            case 5: return "困难 (5×5)";
            default: return "未知";
        }
    }
}